package amushen.two.html.impl;

import amushen.two.html.BaseContainer;

public class Link extends BaseContainer {
	
	private String image;
	
	public String getTagName() {		
		return "A";
	}
	
	public Link(String image) {
		setImage(image);
	}
	public Link(String image,String href) {
		this(image);
		setHref(href);
	}
	
	public String getHref() {
		return (String)getProperties().get("href");
	}

	public void setHref(String href) {
		getProperties().put("href", href);
	}

	public String getImage() {
		return image;
	}

	public void setImage(String image) {
		this.image = image;
	}
	
	public String getContent() {
		String cont=super.getContent();
		if(getImage()!=null&&getImage().length()>0){
			cont+="<img src='"+getImage()+"' />";
		}
		return cont;
	}
}
